package com.topdt.jbpm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.topdt.jbpm.dao.HistTodoDao;
import com.topdt.jbpm.model.HistTodo;

@Service
@Transactional(readOnly = true)
public class HistTodoService {
	@Autowired
	private HistTodoDao histTodoDao;

	/**
	 * 根据work_id删除wf_his_todo表中记录
	 * @author 刘杰
	 * @date   May 15, 2014 3:02:09 PM 
	 * @param delIds
	 */
	@Transactional(readOnly = false)
	public void delWorks(String[] delIds) {
		String delIdsStr = "";
		for (int i = 0; i < delIds.length; i++) {
			if (i == 0) {
				delIdsStr += "'"+delIds[i]+"'";
			} else {
				delIdsStr += "," + "'"+delIds[i]+"'";
			}
		}		
		histTodoDao.deleteWorks(delIdsStr);
	}

}